﻿using housingsafety.server.Helpers;
using housingsafety.server.Security;
using Microsoft.AspNetCore.Http;

namespace housingsafety.server.Svcs
{
    /// <summary>
    /// token认证
    /// </summary>
    public interface ITokenHelper
    {
        /// <summary>
        /// 认证
        /// </summary>
        /// <param name="token"></param>
        /// <param name="jwt"></param>
        /// <param name="httpContext"></param>
        /// <param name="timestampSkewSec"></param>
        /// <returns></returns>
        RespRet Valid(WebAPISign token, string jwt, HttpContext httpContext, long timestampSkewSec);

        /// <summary>
        /// 生成token
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="jwt"></param>
        /// <param name="uri"></param>
        /// <returns></returns>
        WebAPISign Make(string userId, string jwt, string uri);
    }
}
